<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<style type="text/css">
	#page{
	float:right;
	margin:10px;
	}
	#page li{
	width:auto;
	height:20px;
	line-height:20px;
	padding-left:5px;
	padding-right:5px;
	margin-right:10px;
	border:1px solid black;
	float:left;
	list-style:none;
	font-size:12px;
	}
	#page li a{
		text-decoration:none;
	}
</style>
	<ul id="page">
		<input name="currPageNo" type="hidden" value="${pageInfo.pageNum }"/>
		<input name="pageCount" type="hidden" value="${pageInfo.pages}"/>
		<li><a href="javascript:doFirst();">首页</a></li>
		<li class=".arrow2"><a href="javascript:doBefore();">上一页</a></li>
		<c:forEach varStatus="status" begin="1" end="${pageInfo.pages}">
			<li><a href="javascript:doPer(${status.count});">${status.count}</a></li>
		</c:forEach>
		<li class=".arrow3"><a href="javascript:doNext();">下一页</a></li>
		<li><a href="javascript:doLast();">尾页</a></li>
		<li>${pageInfo.pageNum }/${pageInfo.pages}</li>
	</ul>
<script type="text/javascript">
	function doFirst(){
		frm.currPageNo.value=1;
		frm.submit();
	}
	function doNext(){
		if(frm.currPageNo.value>=frm.pageCount.value){
			layer.msg('已经是最后一页了!',{icon:2,time:1000});
			//alert('已经是最后一页了!');
			return;
		}
		frm.currPageNo.value=parseInt(frm.currPageNo.value)+1;
		frm.submit();
	}
	function doBefore(){
		if(frm.currPageNo.value<=1){
			layer.msg('已经是第一页了!',{icon:2,time:1000});
			//alert('已经是最后一页了!');
			return;
		}
		frm.currPageNo.value=parseInt(frm.currPageNo.value)-1;
		frm.submit();
	}
	function doLast(){
		frm.currPageNo.value=frm.pageCount.value;
		frm.submit();
	}
	function doPer(index){
		frm.currPageNo.value=index;
		frm.submit();
	}
</script>
